Skip to content

Make wolfCrypt ASN cert parsing functionality public.#4645

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
haydenroche5:parse_cert_public
Dec 11, 2021
Merged

Make wolfCrypt ASN cert parsing functionality public.#4645
dgarske merged 1 commit intowolfSSL:masterfrom
haydenroche5:parse_cert_public

Conversation

@haydenroche5
Copy link
Copy Markdown
Contributor

Currently, the ParseCert function is only available if WOLFSSL_ASN_API is
defined to WOLFSSL_API. The only way to achieve this without enabling the
compatibility layer is to define WOLFSSL_TEST_CERT. There are users defining
this so that they can parse certs with wolfCrypt, even though this doesn't seem
to be the original intent of the define. This commit adds the function
wc_ParseCert to the public wolfCrypt API. It's simply a wrapper around
ParseCert. Similarly, this commit adds wc_InitDecodedCert and
wc_FreeDecodedCert to the public API, which are wrappers around
InitDecodedCert and FreeDecodedCert, respectively.

@haydenroche5 haydenroche5 self-assigned this Dec 9, 2021
Copy link
Copy Markdown
Member

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I double checked and those internal functions DO have argument checking on them. Luckily.

Comment thread wolfssl/wolfcrypt/asn_public.h Outdated
Comment thread wolfssl/wolfcrypt/asn_public.h Outdated
Currently, the `ParseCert` function is only available if `WOLFSSL_ASN_API` is
defined to `WOLFSSL_API`. The only way to achieve this without enabling the
compatibility layer is to define `WOLFSSL_TEST_CERT`. There are users defining
this so that they can parse certs with wolfCrypt, even though this doesn't seem
to be the original intent of the define. This commit adds the function
`wc_ParseCert` to the public wolfCrypt API. It's simply a wrapper around
`ParseCert`. Similarly, this commit adds `wc_InitDecodedCert` and
`wc_FreeDecodedCert` to the public API, which are wrappers around
`InitDecodedCert` and `FreeDecodedCert`, respectively.
@dgarske dgarske requested review from cconlon and removed request for julek-wolfssl December 10, 2021 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants